{template head}

<body>
<script type="text/javascript">
var ajaxparam = {
		'url' : '{CONTROL_URL}?a={$action}'
};

function submitcheck()
{
	return true;
}

function saveinfo()
{
	if(!submitcheck())
	{
		return;
	}
	var url = '{SITE_URL}ajax/index.php?m=saveAdmin';
	
	var data = $('#savedata').serialize();
		
	var callback = function(data)
	{
		if(data.sign == -2)
		{
			window.location = data.url;
		}
		else
		{
			if(data.sign == 1)
			{
				//添加成功,返回列表页
				layer.alert(data.msg,function(){
					window.location = $('#gotoList').attr('href');
				});
			}
			else
			{
				if(data.msg)
				{
					layer.msg(data.msg);
				}
				else
				{
					layer.msg('操作失败');
				}
			}
		}
	};
	makeAjax('post',url,data,callback);
}


</script>
<div class="wrapper">
	<div class="crumbs"><span style="margin: 0 5px;color: #333;font-size: 14px;">{$fTitle}</span> &gt; <a id="gotoList" href="{SITE_URL}index.php?a=adminM">{$sTitle}</a> &gt; <span>{$tTitle}<a style="float:right;font-size:13px;" href="javascript:history.go(-1);">返回</a></span></span>

	<div class="container_tit clearfix mb20 ft14">
		
	<form id="savedata">
		<input type="hidden" name="id" value="{$admin[id]}" />
		<h2 class="form_tit">人员信息  </h2>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">员工姓名：</label>
				<input type="text" id="nickname" name="nickname" value="{$admin[nickname]}" class="text w200" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">员工工号：</label>
				<input type="text" id="gonghao" name="gonghao" value="{$admin[gonghao]}" class="text w200" />
			</p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">登录帐号：</label>
				{if !empty($admin)}
				<input disabled type="text" id="loginname" name="loginname" value="{$admin[loginname]}" class="text w200" />
				{else}
				<input type="text" id="loginname" name="loginname" class="text w200" />
				{/if}
		    </p>
		</div>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">登录密码：</label>
				<text style="height: 28px;line-height: 28px;">默认登录密码为123456,员工登录后可自行修改</text>
			</p>
		</div>
		<div class="form_item clearfix">
			<p class="clearfix">
				<label class="name">角色选择：</label>
				<select class="select w200" name="role">
	            	<option value="">请选择角色</option>
	            	{loop $rolelist $k $v}
  						<option value="{$v['id']}" {if $admin['roleid'] == $v['id']}selected{/if}>{$v['name']}</option>
        			{/loop}
	            </select>
        		
			</p>
       </div>
        <div class="form_item clearfix">
			<p class="clearfix" style="height: 28px;line-height: 28px;">
				<label class="name">是否启用：</label>
				<input style="vertical-align: middle;" {if $admin['status'] == '1' || empty($chanpin['cp_status'])}checked{/if} class="checkbox" type="radio" name="status" value="1" />
				<label for="resort_index" class="mr15">禁用</label>
				<input style="vertical-align: middle;" {if $admin['status'] == '2'}checked{/if} class="checkbox" type="radio" name="status" value="2" />
				<label for="resort_index">启用</label>
			</p>
		</div>
        <div class="form_item clearfix">
			<p class="clearfix">
				<label class="name"></label>
			    <input type="button" class="btnblue" value="提交" onclick="saveinfo()" />
			</p>
		</div>
    </form>
    </div>
</div>
</body>
{template foot}
